<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddStateLocationUsers extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('users', function (Blueprint $table) {
            $table->tinyInteger('state')->default(1)->comment('是否关注');
            $table->integer('unsubtime')->nullable()->comment('取消关注事件');
            $table->string('qr_code')->nullable()->comment('场景二维码');
            $table->integer('p1')->default(0)->comment('上级');
            $table->integer('p2')->default(0)->comment('上上级');
            $table->integer('p3')->default(0)->comment('上上上级');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('users', function (Blueprint $table) {
            $table->dropColumn('state');
            $table->dropColumn('unsubtime');
            $table->dropColumn('qr_code');
            $table->dropColumn('p1');
            $table->dropColumn('p2');
            $table->dropColumn('p3');
        });
    }
}
